package com.fzdy.dataplatform.dao.vo.impl;



import com.fzdy.dataplatform.controller.api.statistics.SeachApi;
import com.fzdy.dataplatform.core.dao.impl.BaseDaoImpl;
import com.fzdy.dataplatform.dao.vo.UserDeviceStatisticsVoDao;
import com.fzdy.dataplatform.entity.UserDeviceStatisticsVo;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class UserDeviceStatisticsVoDaoImpl extends BaseDaoImpl<UserDeviceStatisticsVo> implements UserDeviceStatisticsVoDao {
    @Override
    public List<UserDeviceStatisticsVo> findAll(SeachApi seachApi) {
        Criteria crit = this.getSession().createCriteria(this.clazz);
        crit.add(Restrictions.eq("id",seachApi.getUserid()));
        crit.add(Restrictions.between("createdate",seachApi.getStartDate(),seachApi.getEndDate()));
        List<UserDeviceStatisticsVo> list=crit.list();
        return list;
    }
}
